//
// Created by Lenovo on 2020/8/26.
//

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 1e3+10;
const int mod = 1e5+3;
int dp[maxn];
void init()
{
    dp[1] = 0;
    dp[2] = 3;
    dp[4] = 11;
    dp[3] = 0;
    for(int i = 5;i<maxn;i++)
    {
        if(i%2)dp[i] = 0;
        else dp[i] = (((dp[i-2]*4)%mod-dp[i-4])+mod)%mod;
    }
}

int main()
{
    init();
    int n;
    while(scanf("%d",&n)!=EOF&&n!=0) printf("%d\n",dp[n]);
}
